<%

scenarios = [
  ["user management", url_for(:controller => '/users')],
  ["habtm", url_for(:controller => 'nature/lakes')],
  ["has_many", url_for(:controller => 'nature/parks')],
  ["belongs_to", url_for(:controller => 'nature/dens')],
  ["has_one", url_for(:controller => 'nature/bears')],
  ["join model", url_for(:controller => 'nature/dens')],
  ["polymorphic", url_for(:controller => 'nature/tracking_devices')],
  ["security", url_for(:controller => '/secured_records')],
  ["field/form overrides", url_for(:controller => '/roles')]
]

controllers = Dir['app/controllers/**/*_controller.rb'].collect {|c| c.sub('app/controllers', '').sub('_controller.rb', '')}
controllers.delete('demo')

%>
<div id="jump">
  <label>Go to demo:</label>
  <select onchange="window.location = this.value">
    <option>Scenario:</option>
    <%= options_for_select scenarios %>
  </select>

  <select onchange="window.location = this.value">
    <option>Scaffold:</option>
    <%= options_for_select controllers.sort.collect {|c| [File.basename(c), c]} %>
  </select>
</div>